import http from '../index.js'

// 生成订单
export function createOrder2Api(params) {
  return http.post('/saveOrder', params);
}

// 获取订单列表
export function getOrderList(params) {
  return http.get('/order', params);
}

// 获取订单详情
export function getOrderDetail(id) {
  return http.get(`/order/${id}`);
}

// 订单取消
export function cancelOrder(id) {
  return http.put(`/order/${id}/cancel`);
}

// 订单确认收货
export function confirmOrder(id) {
  return http.put(`/order/${id}/finish`)
}

// 订单支付
export function payOrder(params) {
  return http.get('/paySuccess', params )
}